﻿using System;


using mvcForum.Core;
using mvcForum.Core.Abstractions;
using mvcForum.Core.Interfaces.Data;

namespace mvcForum.AddOns.StopForumSpam {

	public class StopForumSpamConfiguration : AsyncAddOnConfiguration<StopForumSpamAddOn> {

		public StopForumSpamConfiguration(IRepository<AddOnConfiguration> configRepo) : base(configRepo) { }

		private static class Keys {
			public const String APIKey = "APIKey";
			public const String MarkAsSpamOnHit = "MarkAsSpamOnHit";
			public const String CheckNewUsers = "CheckNewUsers";
			public const String Enabled = "Enabled";
		}

		public Boolean Enabled {
			get {
				return this.GetBoolean(Keys.Enabled);
			}
			set {
				this.Set(Keys.Enabled, value);
			}
		}

		public String Key {
			get {
				return this.GetString(Keys.APIKey);
			}
			set {
				this.Set(Keys.APIKey, value);
			}
		}

		public Boolean CheckNewUsers {
			get {
				return this.GetBoolean(Keys.CheckNewUsers);
			}
			set {
				this.Set(Keys.CheckNewUsers, value);
			}
		}

		public Boolean MarkAsSpamOnHit {
			get {
				return this.GetBoolean(Keys.MarkAsSpamOnHit);
			}
			set {
				this.Set(Keys.MarkAsSpamOnHit, value);
			}
		}
	}
}